package a.g;

import a.c.d;
import a.c.k;
import a.c.m;
import a.c.n;
import a.f.cd;
import a.f.dd;
import a.f.ed;
import a.f.o;
import a.h.dc;
import a.h.kc;
import a.h.z;
import a.i.db;
import a.i.t;
import a.j.g;
import a.j.ke;

import java.util.WeakHashMap;

public class bb
  extends h
{
  static final String q = "PORT_CONSTRAINTS";
  static final String r = "CONFIGURATION_METHOD";
  static final String s = "FROM_SKETCH";
  static final String t = "ENTER_MANUALLY";
  static final String u = "NORTH";
  static final String v = "SOUTH";
  static final String w = "WEST";
  static final String x = "EAST";
  static final String y = "ANYSIDE";
  static final String z = "ALL";
  static final String A = "SELECTED_EDGES";
  static final String B = "SELECTED_NODES";
  static final String C = "SIDE_AT_SOURCE";
  static final String D = "SIDE_AT_TARGET";
  static final String E = "SOURCE_PORT_FIXED";
  static final String F = "TARGET_PORT_FIXED";
  static final String G = "SPHERE_OF_ACTION";
  static final String H = "REMOVE_ALL";
  static final String[] I = { "FROM_SKETCH", "ENTER_MANUALLY" };
  static final String[] J = { "NORTH", "SOUTH", "EAST", "WEST", "ANYSIDE" };
  static final String[] K = { "ALL", "SELECTED_EDGES", "SELECTED_NODES" };
  private g L;
  private n M;
  private n N;
  public static int O;
  
  public bb()
  {
    super("PORT_CONSTRAINTS", "yWorks GmbH", "Configures port constraints.");
  }
  
  protected dc j()
  {
    dc localdc = new dc(a());
    localdc.a("CONFIGURATION_METHOD", I, 0);
    kc localkc1 = localdc.a("SIDE_AT_SOURCE", J, 0);
    kc localkc2 = localdc.a("SIDE_AT_TARGET", J, 0);
    localdc.a("SOURCE_PORT_FIXED", false);
    localdc.a("TARGET_PORT_FIXED", false);
    localdc.a("SPHERE_OF_ACTION", K, 0);
    localdc.a("REMOVE_ALL", false);
    z localz = new z(localdc);
    localz.a("REMOVE_ALL", Boolean.FALSE, "CONFIGURATION_METHOD");
    z.t_ localt_1 = localz.a("REMOVE_ALL", Boolean.FALSE);
    z.t_ localt_2 = localz.a("CONFIGURATION_METHOD", I[1]);
    z.t_ localt_3 = localt_2.b(localt_1);
    localz.a(localt_3, localkc1);
    localz.a(localt_3, localkc2);
    localz.a("REMOVE_ALL", Boolean.FALSE, "SPHERE_OF_ACTION");
    localz.a("REMOVE_ALL", Boolean.FALSE, "SOURCE_PORT_FIXED");
    localz.a("REMOVE_ALL", Boolean.FALSE, "TARGET_PORT_FIXED");
    return localdc;
  }
  
  protected void n()
  {
    int j = f.p;
    boolean bool3 = f.o;
    z();
    dc localdc = i();
    if (j == 0)
    {
      if (localdc.g("REMOVE_ALL")) {
        A();
      }
    }
    else {
      return;
    }
    n localn1 = null;
    n localn2 = null;
    String str1 = localdc.h("SPHERE_OF_ACTION");
    if (j == 0) {
      if (str1.equals("ALL"))
      {
        localm = this.L.w();
        if ((j == 0) && (!bool3)) {
          break label182;
        }
      }
    }
    if (str1.equals("SELECTED_EDGES"))
    {
      if (j != 0) {
        break label114;
      }
      localm = this.L.S();
      if (!bool3) {
        break label182;
      }
    }
    label114:
    localn1 = this.M;
    localn2 = this.N;
    this.M = new a_(this.M, q.a(ke.b(this.L)));
    this.N = new a_(this.N, q.b(ke.b(this.L)));
    m localm = this.L.w();
    label182:
    String str2 = localdc.h("CONFIGURATION_METHOD");
    boolean bool1 = localdc.g("SOURCE_PORT_FIXED");
    boolean bool2 = localdc.g("TARGET_PORT_FIXED");
    if (j == 0) {
      if (str2.equals("FROM_SKETCH"))
      {
        a(this.L, localm, this.M, bool1, this.N, bool2);
        if ((j == 0) && (!bool3)) {
          break label480;
        }
      }
    }
    byte[] arrayOfByte = new byte[2];
    String[] arrayOfString = { "SIDE_AT_SOURCE", "SIDE_AT_TARGET" };
    int i = 0;
    label437:
    do
    {
      if (i >= arrayOfByte.length) {
        break;
      }
      String str3 = localdc.h(arrayOfString[i]);
      if ((j == 0) && (bool3)) {
        break label480;
      }
      if (j == 0) {
        if (str3.equals("NORTH"))
        {
          arrayOfByte[i] = 1;
          if (j != 0) {
            continue;
          }
          if (!bool3) {
            break label437;
          }
        }
      }
      if (j == 0) {
        if (str3.equals("SOUTH"))
        {
          arrayOfByte[i] = 2;
          if (j != 0) {
            continue;
          }
          if (!bool3) {
            break label437;
          }
        }
      }
      if (j == 0) {
        if (str3.equals("EAST"))
        {
          arrayOfByte[i] = 4;
          if (j != 0) {
            continue;
          }
          if (!bool3) {
            break label437;
          }
        }
      }
      if (j == 0)
      {
        if (str3.equals("WEST")) {
          arrayOfByte[i] = 8;
        }
      }
      else
      {
        if (j != 0) {
          continue;
        }
        if (!bool3) {
          break label437;
        }
      }
      arrayOfByte[i] = 0;
      i++;
    } while (!bool3);
    if (j == 0)
    {
      a(this.L, localm, this.M, arrayOfByte[0], bool1, this.N, arrayOfByte[1], bool2);
      label480:
      if (localn1 == null) {}
    }
    else
    {
      this.M = localn1;
      localn1 = null;
      this.N = localn2;
      localn2 = null;
    }
  }
  
  private void z()
  {
    int i = f.p;
    boolean bool = f.o;
    this.L = e();
    k localk = this.L.c(ed.a);
    if (i == 0)
    {
      if (localk != null) {
        if (i == 0)
        {
          if ((localk instanceof n))
          {
            this.M = ((n)localk);
            if (i != 0) {
              break label101;
            }
          }
        }
        else {
          if (!bool) {
            break label90;
          }
        }
      }
      this.M = db.b(new WeakHashMap());
    }
    else
    {
      this.L.a(ed.a, this.M);
    }
    label90:
    localk = this.L.c(ed.b);
    label101:
    if (i == 0)
    {
      if (localk != null) {
        if (i == 0)
        {
          if ((localk instanceof n))
          {
            this.N = ((n)localk);
            if (i != 0) {
              break label150;
            }
          }
        }
        else if (!bool) {
          return;
        }
      }
      this.N = db.b(new WeakHashMap());
    }
    label150:
    this.L.a(ed.b, this.N);
  }
  
  private void A()
  {
    int i = f.p;
    this.L = e();
    if (i == 0)
    {
      if (this.L.c(ed.a) != null) {
        this.L.j(ed.a);
      }
      if (i != 0) {}
    }
    else if (this.L.c(ed.b) != null)
    {
      this.L.j(ed.b);
    }
    if (i == 0)
    {
      if (this.M != null)
      {
        this.L.a(this.M);
        this.M = null;
      }
      if (i != 0) {}
    }
    else
    {
      if (this.N == null) {
        return;
      }
      this.L.a(this.N);
    }
    this.N = null;
  }
  
  private void a(o paramo, m paramm, n paramn1, boolean paramBoolean1, n paramn2, boolean paramBoolean2)
  {
    dd localdd = new dd();
    localdd.a(paramo, paramm, paramn1, paramBoolean1, paramn2, paramBoolean2);
  }
  
  private void a(o paramo, m paramm, n paramn1, byte paramByte1, boolean paramBoolean1, n paramn2, byte paramByte2, boolean paramBoolean2)
  {
    boolean bool = f.o;
    do
    {
      if (!paramm.e()) {
        break;
      }
      d locald = paramm.a();
      paramn1.a(locald, cd.a(paramByte1, paramBoolean1));
      paramn2.a(locald, cd.a(paramByte2, paramBoolean2));
      paramm.f();
    } while (!bool);
  }
  
  static class a_
    extends t
  {
    n b;
    k c;
    
    a_(n paramn, k paramk)
    {
      this.b = paramn;
      this.c = paramk;
    }
    
    public void a(Object paramObject1, Object paramObject2)
    {
      if ((f.p != 0) || (this.c.getBool(paramObject1))) {
        this.b.a(paramObject1, paramObject2);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.bb

 * JD-Core Version:    0.7.0.1

 */